-- stack: in -- format: 8 (HyperCard 1) -- flags: 0x1000 (none) -- protect password hash: 0 -- maximum user level: 5 (scripting) -- window: Rect(x1=0, y1=0, x2=0, y2=0) -- screen: Rect(x1=0, y1=0, x2=0, y2=0) -- card dimensions: w=0 h=0 -- scroll: x=0 y=0 -- background count: 4 -- first background id: 7320 -- card count: 16 -- first card id: 5967 -- list block id: 2111 -- print block id: 3470 -- font table block id: 0 -- style table block id: 0 -- free block count: 0 -- free size: 0 bytes -- total size: 121280 bytes -- stack block size: 15872 bytes -- created by hypercard version: 0x01258000 -- compacted by hypercard version: 0x01258000 -- modified by hypercard version: 0x01258000 -- opened by hypercard version: 0x01258000 -- patterns[0]: 0x0000000000000000 -- patterns[1]: 0x0000220000002200 -- patterns[2]: 0x8800220088002200 -- patterns[3]: 0xCC003300CC003300 -- patterns[4]: 0xCC883322CC883322 -- patterns[5]: 0xEE88BB22EE88BB22 -- patterns[6]: 0xEECCBB33EECCBB33 -- patterns[7]: 0xFFCCFF33FFCCFF33 -- patterns[8]: 0xFFEEFFBBFFEEFFBB -- patterns[9]: 0xFFFFFFBBFFFFFFBB -- patterns[10]: 0x8010022001084004 -- patterns[11]: 0xFFFFFFFFFFFFFFFF -- patterns[12]: 0x8822882288228822 -- patterns[13]: 0x1122448811224488 -- patterns[14]: 0xC4800C6843023026 -- patterns[15]: 0xB130031BD8C00C8D -- patterns[16]: 0xAA00AA00AA00AA00 -- patterns[17]: 0x8822552288225522 -- patterns[18]: 0x8855225588552255 -- patterns[19]: 0x77DD77DD77DD77DD -- patterns[20]: 0x8000000000000000 -- patterns[21]: 0xAA55AA55AA55AA55 -- patterns[22]: 0x1028458204380000 -- patterns[23]: 0x8244394482010101 -- patterns[24]: 0x8814224188412214 -- patterns[25]: 0x8080413E080814E3 -- patterns[26]: 0x22048C7422179810 -- patterns[27]: 0xBE808808EB088880 -- patterns[28]: 0x0100000010000000 -- patterns[29]: 0xA29C41BE2AC914EB -- patterns[30]: 0x40A00000040A0000 -- patterns[31]: 0x8040200002040800 -- patterns[32]: 0xAA00800088008000 -- patterns[33]: 0xFF80808080808080 -- patterns[34]: 0x081C22C180010204 -- patterns[35]: 0xFF808080FF080808 -- patterns[36]: 0xF87422478F172271 -- patterns[37]: 0xBF00BFBFB0B0B0B0 -- patterns[38]: 0xFF7FBE5DA2418000 -- patterns[39]: 0xFAF5FAF5A050A050 -- checksum: 0x0 ----- HyperTalk script ----- —————————Navigational Handlers—————————— on openstack global DMmenu,MnstrMenu,MagicMenu,EquipMenu put NewMenu("DM","Help...","Preferences...","(-","Dice...", "Sort Cards","Show Cards","(-","Notebook") into DMmenu put cd fld "Monster Index" of cd 1 of bg "bMnstr" into MnstrMenu put cd fld "Magic Index" of cd 1 of bg "cwiz" into MagicMenu put cd fld "Equip Index" of cd 1 of bg "eItem" into EquipMenu end openstack on closeStack global DMmenu if the freeSize of this stack>15000 then sulvl doMenu "compact stack" rulvl end if get deleteMenu(DMmenu) end closeStack on doMenu which -- get our menu items before HyperCard does if which is "Help..." then send mouseup to bg btn "help" else if which is "Preferences..." then pref else if which is "Dice..." then ask "Specify dice to roll..." with "d20" answer "The result is"&&rolldice(it)&"." with "OK" else if which is "Sort Cards" then sortem else if which is "Show Cards" then showcd else if which is "Notebook" then gonotes else if which is "-" then exit doMenu else pass doMenu -- Remember to pass untrapped menu commands! end doMenu on closebackground global bmnstr,cwiz do "put the long name of this card into"&&the short name of this background end closebackground on gonext get id of last card of this background visual wipe left if id of this card is it then go to card 1 of this background else go to next card end gonext on goprev get id of card 1 of this background visual wipe right if id of this card is it then go to last card of this background else go to previous card end goprev on godm visual scroll up go to card 1 of "Dungeon Mastery" end godm on goadv global adv visual scroll up if adv is empty then go "the adventure to open" else go adv end goadv on goenc global enc visual scroll up if enc is empty then go to card 1 of background "Enc" of "Dungeon Mastery" else go enc end goenc on goexp global exp visual scroll up if exp is empty then go to card 1 of background "Exp" of "Dungeon Mastery" else go exp end goexp on gocom global com visual scroll up if com is empty then go to card 1 of background "Com" of "Dungeon Mastery" else go com end gocom on gonotes global notes visual scroll up if notes is empty then go to card 1 of background "Notes" of "Dungeon Mastery" else go notes end gonotes on goutil visual scroll up go to card "Utilities" of "Dungeon Mastery" end goutil on gohero visual scroll up go to card 1 of background "ahero" of "DM Reference" end gohero on gomnstr global bmnstr visual scroll up chkbg if bmnstr is empty then go to card 1 of background "bmnstr" of "DM Reference" else go bmnstr end gomnstr on gowiz global cwiz visual dissolve chkbg if cwiz is empty then go to card 1 of background "cwiz" of "DM Reference" else go cwiz end gowiz on goitm visual scroll up go to card 1 of background "eitem" of "DM Reference" end goitm on gocal lock screen go to card 1 of background "cal" of "Dungeon Mastery" if line 2 of field id 76 is not empty then go to line 2 of field id 76 unlock screen with visual scroll up end gocal on chkbg if the short name of the target is the short name of this background then go to card 1 of this background exit to hypercard end if end chkbg ——————————Preferences Handlers—————————— on pref global hldcd push card pop card into hldcd lock screen go to card 1 of this background if the short name of this bg is "ahero" then repeat with i=18 to 24 show button id i end repeat show button "OK" show card field "backdrop" show card field "descript" else show cd field "Preferences" show cd button "OK" if the short name of this bg is "bmnstr" then put "monster" into nm else if the short name of this bg is "cwiz" then put "magic" into nm else if the short name of this bg is "eitem" then put "equip" into nm set the locktext of cd field (nm&&"Index") to false set the Style of cd field (nm&&"Index") to rectangle set the showlines of cd field (nm&&"Index") to true show cd field (nm&&"Index") end if unlock screen with visual zoom open end pref ——————————Sort Cards Handlers—————————— on sortem lockem true set cursor to busy put the id of this cd into rtncd put the number of this background into bgnum sort by backgroundSort(bgnum) go to rtncd end sortem function backgroundSort bgnum set cursor to busy if the number of this bg <> bgnum then return the short name of this background else do "put (the short name of this bg)&(bg field Cat"&bgnum& ")&(bg field Name"&bgnum&") into bgsrt" return bgsrt end if end backgroundSort ——————————Show Cards Handlers—————————— on showcd put number of this card into thiscd lock screen go to last card of this background put number of this card into lastcd go to card thiscd unlock screen show (lastcd-thiscd) cards end showcd ——————————Help Handlers—————————— on gohelp winname lock screen push card go to first card of this background hide card picture hide card button "obscure 1" show card button winname show card button "Close box" if the short name of this background is "aHero" then set the scroll of field "descript" to 0 set the locktext of field "descript" to true hide card field "Party" else if the short name of this background is "bMnstr" then set the scroll of field "descript" to 0 set the locktext of field "descript" to true if the visible of cd btn "OK" is false then hide card field "Monster Index" end if else if the short name of this background is "cWiz" then show card field "Magic Help" if the visible of cd btn "OK" is false then hide card field "Magic Index" end if else if the short name of this background is "eItem" then show card field "Equipment Help" if the visible of cd btn "OK" is false then hide card field "Equip Index" end if end if unlock screen with visual zoom open end gohelp on closehelp winname lock screen show card picture show card button "obscure 1" hide card button winname hide card button "Close box" if the short name of this background is "aHero" then set the locktext of field "descript" to false show card field "Party" else if the short name of this background is "bMnstr" then set the locktext of field "descript" to false show card field "Monster Index" else if the short name of this background is "cWiz" then hide card field "Magic Help" show card field "Magic Index" else if the short name of this background is "eItem" then hide card field "Equipment Help" show card field "Equip Index" end if pop card unlock screen with visual zoom close end closehelp ——————————Utility Handlers—————————— on lockem which set lockscreen to which set lockmessages to which set lockrecent to which end lockem on sulvl global ulsv put the userlevel into ulsv if ulsv < 4 then set the userLevel to 4 end sulvl on rulvl global ulsv set the userLevel to ulsv end rulvl function clkln return ((item 2 of the clickloc - item 2 of the rect of the target) div the textheight of the target) + 1 end clkln on nick nm global nknm put nm into field "nickname" if chknm() is false then set the name of this card to nm put "true" into nknm exit nick end if end nick function chknm put true into chk put field "nickname" into nm put the id of this card into nmid push card go to card nm if the id of this card is nmid then put false into chk pop card return chk end chknm function rolldice type put interp(type) into cmdb put empty into roll repeat with i=1 to item 1 of cmdb repeat with j=1 to item 2 of cmdb add random(item 3 of cmdb) to roll end repeat add item 4 of cmdb to roll end repeat return roll end rolldice function interp type put ",,," into cmdb if "x" is in type then put 1 into itm else put 2 into itm repeat with i=1 to length of type put character i of type into chr if chr is "x" then put 2 into itm else if chr is "d" then put 3 into itm else if chr is "+" or chr is "-" then if chr≠"+" then put chr into item 4 of cmdb put 4 into itm else put chr after item itm of cmdb end repeat if item 1 of cmdb is empty then put 1 into item 1 of cmdb if item 2 of cmdb is empty then put 1 into item 2 of cmdb if item 3 of cmdb is empty then put 1 into item 3 of cmdb if item 4 of cmdb is empty then put 0 into item 4 of cmdb return cmdb end interp on svthrw clvr put item 1 of clvr into cls put item 2 of clvr into lv put item 3 of clvr into rc if lv=0 then savtab "16,18,17,20,19" else if cls is "Warrior" then if lv>16 then savtab "3,5,4,4,6" else if lv>14 then savtab "4,6,5,4,7" else if lv>12 then savtab "5,7,6,5,8" else if lv>10 then savtab "7,9,8,8,10" else if lv> 8 then savtab "8,10,9,9,11" else if lv> 6 then savtab "10,12,11,12,13" else if lv> 4 then savtab "11,13,12,13,14" else if lv> 2 then savtab "13,15,14,16,16" else savtab "14,16,15,17,17" else if cls is "Priest" then if lv>18 then savtab "2,6,5,8,7" else if lv>15 then savtab "4,8,7,10,9" else if lv>12 then savtab "5,9,8,11,10" else if lv> 9 then savtab "6,10,9,12,11" else if lv> 6 then savtab "7,11,10,13,12" else if lv> 3 then savtab "9,13,12,15,14" else savtab "10,14,13,16,15" else if cls is "Rogue" then if lv>20 then savtab "8,4,7,11,5" else if lv>16 then savtab "9,6,8,12,7" else if lv>12 then savtab "10,8,9,13,9" else if lv> 8 then savtab "11,10,10,14,11" else if lv> 4 then savtab "12,12,11,15,13" else savtab "13,14,12,16,15" else if cls is "Wizard" then if lv>20 then savtab "8,3,5,7,4" else if lv>15 then savtab "10,5,7,9,6" else if lv>10 then savtab "11,7,9,11,8" else if lv> 5 then savtab "13,9,11,13,10" else savtab "14,11,13,15,12" end if end if if rc is "Dwarf" or rc is "Halfling" or rc is "Gnome" then put trunc(2*(line 2 of field "Abilities")/7) into svadj subtract svadj from field "Staff/Wand" subtract svadj from field "Spells" if rc is not "Gnome" then subtract svadj from field "Poison Sv" end if if the short name of this background is "aHero" then if "paladin" is in line 1 of field "Char Info" then subtract 2 from field "Paralyze" subtract 2 from field "Poison Sv" subtract 2 from field "Staff/Wand" subtract 2 from field "Petrify/Polymorph" subtract 2 from field "Breath Weapon" subtract 2 from field "Spells" end if end if end svthrw on savtab val put item 1 of val into field "Paralyze" if the short name of this background is "aHero" then put item 1 of val into field "Poison Sv" put item 2 of val into field "Staff/Wand" put item 3 of val into field "Petrify/Polymorph" put item 4 of val into field "Breath Weapon" put item 5 of val into field "Spells" end savtab on wpndmg i put line i of field "weapon" into wpn if line i of field "weapon damage" is empty then put empty into wadj --general weapons if "sword" is in wpn or "axe" is in wpn or "bow" is in wpn then put "1d8" into wadj else if "mace" is in wpn or "flail" is in wpn then put "1d6+1" into wadj else if "hammer" is in wpn or "sling" is in wpn then put "1d4+1" into wadj else if "staff" is in wpn or "club" is in wpn then put "1d6" into wadj else if "dagger" is in wpn then put "1d4" into wadj else if "dart" is in wpn or "knife" is in wpn then put "1d3" into wadj end if --specific weapons if wpn is "2-hand sword" then put "1d10" into wadj else if wpn is "broad sword" or wpn is "morning star" or wpn is "khopesh" then put "2d4" into wadj else if wpn is "scimitar" then put "1d8" into wadj else if wpn is "trident" then put "1d6+1" into wadj else if wpn is "short sword" or wpn is "spear" then put "1d6" into wadj else if wpn is "sickle" then put "1d4+1" into wadj else if wpn is "hand axe" or wpn is "throwing axe" or wpn is "dirk" or wpn is "scourge" then put "1d4" into wadj end if if wadj is not empty then if the short name of this background is "aHero" then put line 1 of field "Stats 2" into dadj else put empty into dadj if (character 1 of dadj)="+" then delete character 1 of dadj put interp(wadj) into wstats add dadj to item 4 of wstats if item 1 of wstats is not 1 then put item 1 of wstats&"x" into wd put item 2 of wstats&"d"&item 3 of wstats after wd if item 4 of wstats>0 then put "+"&item 4 of wstats after wd if item 4 of wstats<0 then put "-"&item 4 of wstats after wd put wd into line i of field "weapon damage" end if end if end wpndmg on wpndmg2 i put line i of field "weapon" into wpn if line i of field "weapon damage 2" is empty then put empty into wadj --general weapons if "sword" is in wpn then put "1d12" into wadj else if "flail" is in wpn then put "2d4" into wadj else if "axe" is in wpn or "bow" is in wpn or "spear" is in wpn then put "1d8" into wadj else if "sling" is in wpn then put "1d6+1" into wadj else if "staff" is in wpn or "mace" is in wpn then put "1d6" into wadj else if "hammer" is in wpn then put "1d4" into wadj else if "club" is in wpn or "dagger" is in wpn then put "1d3" into wadj else if "dart" is in wpn or "knife" is in wpn then put "1d2" into wadj end if --specific weapons if wpn is "2-hand sword" then put "3d6" into wadj else if wpn is "scimitar" or wpn is "short sword" then put "1d8" into wadj else if wpn is "broad sword" or wpn is "morning star" then put "1d6+1" into wadj else if wpn is "khopesh" or wpn is "morning star" then put "1d6" into wadj else if wpn is "hand axe" or wpn is "throwing axe" or wpn is "sickle" then put "1d4" into wadj end if if wadj is not empty then if the short name of this background is "aHero" then put line 1 of field "Stats 2" into dadj else put empty into dadj if (character 1 of dadj)="+" then delete character 1 of dadj put interp(wadj) into wstats add dadj to item 4 of wstats if item 1 of wstats is not 1 then put item 1 of wstats&"x" into wd put item 2 of wstats&"d"&item 3 of wstats after wd if item 4 of wstats>0 then put "+"&item 4 of wstats after wd if item 4 of wstats<0 then put "-"&item 4 of wstats after wd put wd into line i of field "weapon damage 2" end if end if end wpndmg2